<?php
if (isset($_SESSION['lankesi']) && $_SESSION['lankesi'] > 0) {
	//$text = "".$_SESSION['lankesi']."<br />";
	$text='';
	$q = mysql_query1("SELECT `id`,`tid`,`pav` FROM `".LENTELES_PRIESAGA."d_straipsniai` WHERE `d_straipsniai`.`last_data` >= ".escape($_SESSION['lankesi'])." ORDER BY `d_straipsniai`.`last_data` DESC LIMIT 0,5");
	if (mysql_affected_rows() > 0) {
		$text .= "<b>Forumų:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//http://85.232.143.6/nvs/?id,22;p,16;t,6
			$text .= "\t <img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,25;t,".$row['tid'].";s,".$row['id']."#end'>".substr(input($row['pav']),0,20)."...</a><br />\n";
		}
	}

	$q = mysql_query1("SELECT `naujienos`.`id`, `naujienos`.`pavadinimas` FROM `".LENTELES_PRIESAGA."naujienos` WHERE `naujienos`.`data`>=".escape($_SESSION['lankesi'])." ORDER BY `data` DESC LIMIT 10");
	if (mysql_affected_rows() > 0) { 
	$text .= "<hr/><b>Naujienų:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//index.php?id,50;k,22
			$text .= "<img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,50;k,".$row['id']."'>".substr(input($row['pavadinimas']),0,20)."...</a><br />\n";
		}
	}

	$q = mysql_query1("SELECT * FROM `".LENTELES_PRIESAGA."kom` WHERE `data`>=".escape($_SESSION['lankesi'])." ORDER BY `data` DESC LIMIT 10");
	if (mysql_affected_rows() > 0) { 
	$text .= "<hr/><b>Komentarai:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//index.php?id,50;k,22
			if ($row['pid'] == 7) { $extra = "CodeBin"; $link = "c,".$row['kid'].""; } //CODEBIN ?id,7;c,59
			elseif ($row['pid'] == 50) { $extra = "Naujienos"; $link = "k,".$row['kid']; }
			elseif ($row['pid'] == 6) { $extra = "Siuntiniai"; $link = "v,".$row['kid']; } //siuntiniai ?id,50;k,25#162
			elseif ($row['pid'] == 22) { $extra = "Straipsniai"; $link = "t,".$row['kid']; }	//?id,22;p,14;t,14#325
			elseif ($row['pid'] == 46) { $extra = "TODO"; $link = "a,12;v,".$row['kid']; }	//?id,46;a,12;v,8#7
			elseif ($row['pid'] == 7) {  }
			elseif ($row['pid'] == 7) {  }
			$text .= "<img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,".$row['pid'].";".$link."#".$row['id']."' title=\"header=[$extra] body=[<br/>Autorius: <b>".$row['nick']."</b><br/>Data: <b>".$row['data']."</b><br/>Kada: <b>".kada($row['data'])."</b><br/><br/>] fade=[on]\">".substr(input($row['zinute']),0,20)."...</a><br />\n";
		}
	}
	
	
	if (!isset($text) || empty($text)) { $text = ''; }
}
?>